package cn.xej.demo.service.impl;

import cn.xej.demo.Fish;
import cn.xej.demo.User;
import cn.xej.demo.service.CarService;
import cn.xej.demo.service.UserService;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Service;

/**
 * @Author alicat.xu
 * @Date 2021/10/13 3:47 下午
 */
@Service
@DependsOn("userServiceConfig")
public class UserServiceImpl implements UserService {

//    static {
//        System.out.println("UserServiceImpl....");
//    }

    private String name = "user";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "UserServiceImpl{" +
                "name='" + name + '\'' +
                '}';
    }

    @Override
    public User run(CarService carService) {
        System.out.println("UserServiceImpl ..... carService "+carService);
        carService.getCar(new Fish());
        return new User();
    }

    @Override
    public String getType() {
        return "userService";
    }
}
